package cn.net.cfss.fgbp.spi.manage.constant;

import cn.net.cfss.fgbp.base.constant.BaseEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wutao
 * @version 1.0
 * @date 2020/10/13 14:13
 */
public enum OperationTypeEnum implements BaseEnum<OperationTypeEnum, Integer> {


    ADD(1, "新增"),
    UPDATE(2, "修改"),
    DELETE(3, "删除"),
    OTHER(4, "其他"),
    ;

    private Integer value;
    private String displayName;

    OperationTypeEnum(Integer value, String displayName) {
        this.value = value;
        this.displayName = displayName;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDisplayName() {
        return displayName;
    }

    private static Map<Integer, OperationTypeEnum> enumMap = new HashMap<Integer, OperationTypeEnum>();

    static {
        for (OperationTypeEnum en : OperationTypeEnum.values()) {
            enumMap.put(en.getValue(), en);
        }
    }

    public static OperationTypeEnum getEnum(Integer value) {
        return enumMap.get(value);
    }
}
